$hexadecimal = 'afc758'; $decimal = hexdec($hexadecimal); echo $hexadecimal . ' -> decimal value is: ' . $decimal;